/**
 * Copyright (C), 2019-2020, 宇信融汇
 * FileName: TreeSetTest
 * Author:   xbliu
 * Date:     2020/7/14 17:30
 * Description:
 * History:
 * <author>          <time>          <version>          <desc>
 * xbliu           修改时间           版本号              描述
 */
package c_008.collection;

import org.junit.Test;

import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.TreeSet;

/**
 * @Classname TreeSetTest
 * @Description TODO
 * @Date 2020/7/14 17:30
 * @Created by xbliu
 */
public class TreeSetTest {
    @Test
    public void test1() {
        TreeSet set = new TreeSet();
//据类1:
//        set.add(1231);
//        set.add(1231);
//        set.add(-34);
//        set.add(22);
//        set.add(33);
//        set.add(44);
        set.add(new Person("zhangsna", 22));
        set.add(new Person("lisi", 33));
        set.add(new Person("wangliu", 11));
        set.add(new Person("dsafhkjsd", 44));

        System.out.println(set);
        Iterator iterator = set.iterator();
        while (iterator.hasNext()) {
            System.out.println(iterator.next());
        }
    }

    @Test
    public void test2() {
//        String a = "1.012";
//        System.out.println(Double.valueOf(a));

        List list = Arrays.asList(new int[]{123, 456});
        System.out.println(list.size());
        List list1 = Arrays.asList(new Integer[]{123, 456});
        System.out.println(list1.size());
    }
}
